#!/bin/sh
echo "开始查询"
hive -e "select org_name ,
sum(CASE when code_type='取款' then amt else 0 end) as sum_qk,
sum(CASE when code_type='ATM取款' then amt else 0 end) as sum_aqk,
sum(CASE when code_type='ATM存款' then amt else 0 end) as sum_ack,
sum(CASE when code_type='存款' then amt else 0 end) as sum_ck,
sum(CASE when code_type='对公转账' then amt else 0 end) as sum_dgzz,
sum(CASE when code_type='对私转账' then amt else 0 end) as sum_dszz,
sum(CASE when code_type='大额转账' then amt else 0 end) as sum_dzz,
sum(CASE when code_type='理财' then amt else 0 end) as sum_lc,
sum(CASE when code_type='大额存款' then amt else 0 end) as sum_dck
 from dw00.dw_order_info group by org_name ;"
echo $?
echo "查询完成"